package export.monster
{
	import com.game.manager.AnimationManager;
	import base.BaseBullet;
	import base.BaseMonster;
	
	import export.bullet.RegionBullet;
	
	import flash.geom.Rectangle;
	
	public class Monster102 extends BaseMonster
	{
		public function Monster102()
		{
			super();
		}
		
		override protected function initAttribute():void
		{
			super.initAttribute();
			mavo.attackRange = 90;
		}
		
		override protected function initBBDC():void
		{
			bbdc = AnimationManager.getAnimation("Monster102Action");
			bbdc.setAction("idle");
			bbdc.turnRight();
			bbdc.addCallBack(onEnterFrame, onActionOver);
			bodyContainer.addChild(bbdc);
		}
		
		override protected function initCollideArea():void
		{
			collideBox = new Rectangle(-20, -80, 40, 80);
			super.initCollideArea();
		}
		
		override protected function onEnterFrame(action:String, frameCount:int):void
		{
			var b:BaseBullet;
			switch (action)
			{
				case "attack1":
					if(frameCount == 3)
					{
						b = new RegionBullet();
						b.setCollideArea(0, -100, 90 * bbdc.getDirect(), 100);
						b.setDestroyInCount(bbdc.frameLeft);
						b.setOwner(this);
						b.setHurt(getActionHurt(action));
						b.setAction("Monster102Attack1");
						b.setDirect(bbdc.getDirect());
						gc.gameScene.addChild(b);
						magicBulletArray.push(b);
					}
			}
		}
	}
}